<style>
    .layui-form-label {
        width: 70px;
    }
</style>
<div class="layuimini-container">
    <div class="layuimini-main" id="app">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">上传配置</li>
                <li>图片水印</li>
                <li>七牛云OSS</li>
                {if lsAuth()}
                <li>FTP</li>
                <li>阿里云OSS</li>
                <li>腾讯云COS</li>
                {/if}
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">

                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="upload">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">存储方式</label>
                            <div class="layui-input-block">
                                <input type="radio" v-model="upload_type" name="upload_type" lay-filter="upload_type" value="local" title="本地存储" {if 'local'==sysconfig('upload','upload_type')}checked=""{/if}>
                                <input type="radio" v-model="upload_type" name="upload_type" lay-filter="upload_type" value="qnoss" title="七牛云" {if 'qnoss'==sysconfig('upload','upload_type')}checked=""{/if}>
                                {if lsAuth()}
                                {foreach ['ftp'=>'FTP','alioss'=>'阿里云oss','txcos'=>'腾讯云cos'] as $key=>$val}
                                <input type="radio" v-model="upload_type" name="upload_type" lay-filter="upload_type" value="{$key}" title="{$val}" {if $key==sysconfig('upload','upload_type')}checked=""{/if}>
                                {/foreach}
                                {/if}
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">允许类型</label>
                            <div class="layui-input-block">
                                <input type="text" name="upload_allow_ext" class="layui-input" lay-verify="required" lay-reqtext="请输入允许类型" placeholder="请输入允许类型" value="{:sysconfig('upload','upload_allow_ext')}">
                                <tip>英文逗号做分隔符。</tip>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">允许大小（M）</label>
                            <div class="layui-input-block">
                                <input type="text" name="upload_allow_size" class="layui-input" lay-verify="required" lay-reqtext="请输入允许上传大小" placeholder="请输入允许上传大小" value="{:sysconfig('upload','upload_allow_size')}">
                                <tip>设置允许上传大小，单位（M）。</tip>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">图片最长边超过多少自动压缩</label>
                            <div class="layui-input-inline">
                                <input type="number" name="picture_thumb_max" class="layui-input"  placeholder="为空则不压缩" value="{:sysconfig('upload','picture_thumb_max')}">

                            </div>
                        </div>

                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>

                </div>
                <div class="layui-tab-item">
                    <form class="layui-form layuimini-form">

                    <input type="hidden" name="field" value="watermark">
                    <div class="layui-form-item">
                        <label class="layui-form-label">水印开关</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="switch" value="0" title="关闭" {if condition="sysconfig('watermark.switch') eq 0"}checked{/if}>
                            <input type="radio" name="switch" value="1" title="开启" {if condition="sysconfig('watermark.switch') eq 1"}checked{/if}>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">水印位置</label>
                        <div class="layui-input-inline">
                            <input type="text" name="position" value="{:sysconfig('watermark.position')}" autocomplete="off" class="layui-input">
                        </div>
                        <div>1：顶部靠左 2：顶部居中 3：顶部居右 4：中部居左 5：正中 6：中部居右 7：底部居左 8：底部居中 9：底部居右</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">水印类型</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="type" value="1" title="文字" {if condition="sysconfig('watermark.type') eq 1" }checked{/if}>
                            <input type="radio" name="type" value="2" title="图片" {if condition="sysconfig('watermark.type') eq 2" }checked{/if}>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文字大小</label>
                        <div class="layui-input-inline">
                            <input type="number" name="font_size" value="{:sysconfig('watermark.font_size')}" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <!--                        <div class="layui-form-item">-->
                    <!--                                <label class="layui-form-label">字体文件</label>-->
                    <!--                                <div class="layui-input-inline">-->
                    <!--                                    <input type="text" name="font_path" value="{:sysconfig('watermark.font_path')}" autocomplete="off" class="layui-input">-->
                    <!--                                </div>-->
                    <!--                       </div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">文字颜色</label>

                        <div class="layui-input-inline">
                            <input name="font_color" class="layui-input" value="{:sysconfig('watermark.font_color')}"  placeholder="" style="display:initial;width: 80px">

                            <span   data-color="font_color"></span>

                        </div>

                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">文字</label>
                        <div class="layui-input-inline">
                            <input type="text" name="text" value="{:sysconfig('watermark.text')}" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">水印图片</label>
                        <div class="layui-input-block layuimini-upload">
                            <input name="img" class="layui-input layui-col-xs6"  placeholder="请上传PNG类型的图片" value="{:sysconfig('watermark.img')}">
                            <div class="layuimini-upload-btn">
                                <span><a class="layui-btn" data-upload="img" data-upload-number="one" data-upload-type="local" data-thumb="200"  data-upload-exts="png"><i class="fa fa-upload"></i> 上传</a></span>
                                <span><a class="layui-btn layui-btn-normal" id="select_site_ico" data-upload-select="site_ico" data-upload-number="one"><i class="fa fa-list"></i> 选择</a></span>
                            </div>
                            <div class="tip">建议宽度不要超过200px，PNG格式</div>
                        </div>
                    </div>
                    <div class="hr-line"></div>
                    <div class="submit-info text-center">
                        <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                        <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                    </div>
                    </form>
                </div>
                <div class="layui-tab-item">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="qnoss">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">公钥信息</label>
                            <div class="layui-input-block">
                                <input type="text" name="qnoss_access_key" class="layui-input" lay-verify="required" lay-reqtext="请输入公钥信息" placeholder="请输入公钥信息" value="{:sysconfig('qnoss','qnoss_access_key')}">
                                <tip>例子：v-lV3tXev7yyfsfa1jRc6_8rFOhFYGQvvjsAQxdrB</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">私钥信息</label>
                            <div class="layui-input-block">
                                <input type="text" name="qnoss_secret_key" class="layui-input" lay-verify="required" lay-reqtext="请输入私钥信息" placeholder="请输入私钥信息" value="{:sysconfig('qnoss','qnoss_secret_key')}">
                                <tip>例子：XOhYRR9JNqxsWVEO-mHWB4193vfsfsQADuORaXzr</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">存储空间</label>
                            <div class="layui-input-block">
                                <input type="text" name="qnoss_bucket" class="layui-input" lay-verify="required" lay-reqtext="请输入存储桶地域" placeholder="请输入存储桶地域" value="{:sysconfig('qnoss','qnoss_bucket')}">
                                <tip>例子：laysns</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">访问域名</label>
                            <div class="layui-input-block">
                                <input type="text" name="qnoss_domain" class="layui-input" lay-verify="required" lay-reqtext="请输入访问域名" placeholder="请输入访问域名" value="{:sysconfig('qnoss','qnoss_domain')}">
                                <tip>例子：http://q0xqzappp.bkt.clouddn.com</tip>
                            </div>
                        </div>

                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>
                </div>
                <div class="layui-tab-item">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="ftp">
                        <div class="layui-form-item layui-row">
                            <div class="layui-col-md3">
                                <label class="layui-form-label">FTP地址</label>
                                <div class="layui-input-block">
                                    <input type="text" name="host" value="{:sysconfig('ftp','host')}"
                                           required lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-md3">
                                <label class="layui-form-label">端口</label>
                                <div class="layui-input-block">
                                    <input type="number" name="port" value="{:sysconfig('ftp','port')}"
                                           required lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-md3">
                                <label class="layui-form-label">账号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="username" value="{:sysconfig('ftp','username')}" required
                                           lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-md3">
                                <label class="layui-form-label">密码</label>
                                <div class="layui-input-block">
                                    <input type="text" name="password" value="{:sysconfig('ftp','password')}" required lay-verify="required" autocomplete="off" class="layui-input">
                                </div>

                            </div>
                        </div>
                        <div class="layui-form-item layui-row">
                            <div class="layui-col-md3">
                                <label class="layui-form-label">绑定域名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="domain" value="{:sysconfig('ftp','domain')}"
                                           required lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>

                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>

                </div>
                <div class="layui-tab-item">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="alioss">

                        <div class="layui-form-item">
                            <label class="layui-form-label required">公钥信息</label>
                            <div class="layui-input-block">
                                <input type="text" name="access_key_id" class="layui-input" lay-verify="required" lay-reqtext="请输入公钥信息" placeholder="请输入公钥信息" value="{:sysconfig('alioss','access_key_id')}">
                                <tip>例子：FSGGshu64642THSk</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">私钥信息</label>
                            <div class="layui-input-block">
                                <input type="text" name="access_key_secret" class="layui-input" lay-verify="required" lay-reqtext="请输入私钥信息" placeholder="请输入私钥信息" value="{:sysconfig('alioss','access_key_secret')}">
                                <tip>例子：5fsfPReYKkFSGGshu64642THSkmTInaIm</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">数据中心</label>
                            <div class="layui-input-inline">
                                <?php $endpoint=sysconfig('alioss','endpoint');?>
                                <select name="endpoint">
                                    <option {if $endpoint =='hangzhou'}selected{/if} value="hangzhou">华东1（杭州）</option>
                                    <option {if  $endpoint =='shanghai'}selected{/if} value="shanghai">华东2（上海）</option>
                                    <option {if  $endpoint =='qingdao'}selected{/if} value="qingdao">华北1（青岛）</option>
                                    <option {if  $endpoint =='beijing'}selected{/if} value="beijing">华北2（北京）</option>
                                    <option {if  $endpoint =='zhangjiakou'}selected{/if} value="zhangjiakou">华北3（张家口）</option>
                                    <option {if  $endpoint =='huhehaote'}selected{/if} value="huhehaote">华北5（呼和浩特）</option>
                                    <option {if  $endpoint =='shenzhen'}selected{/if} value="shenzhen">华南1（深圳）</option>
                                    <option {if  $endpoint =='heyuan'}selected{/if} value="heyuan">华南2（河源）</option>
                                    <option {if  $endpoint =='chengdu'}selected{/if} value="chengdu">西南1（成都）</option>
                                    <option {if  $endpoint =='hongkong'}selected{/if} value="hongkong">中国（香港）</option>

                                </select>

                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">空间名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="bucket" class="layui-input" lay-verify="required" lay-reqtext="请输入空间名称" placeholder="请输入空间名称" value="{:sysconfig('alioss','bucket')}">
                                <tip>例子：easy-admin</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">访问域名</label>
                            <div class="layui-input-block">
                                <input type="text" name="domain" class="layui-input" lay-verify="required" lay-reqtext="请输入访问域名" placeholder="请输入访问域名" value="{:sysconfig('alioss','domain')}">
                                <tip>例子：easy-admin.oss-cn-shenzhen</tip>
                            </div>
                        </div>


                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>

                </div>

                <div class="layui-tab-item">
                    <form  class="layui-form layuimini-form">

                        <input type="hidden" name="field" value="txcos">

                        <div class="layui-form-item">
                            <label class="layui-form-label required">公钥信息</label>
                            <div class="layui-input-block">
                                <input type="text" name="txcos_secret_id" class="layui-input" lay-verify="required" lay-reqtext="请输入公钥信息" placeholder="请输入公钥信息" value="{:sysconfig('txcos','txcos_secret_id')}">
                                <tip>例子：AKIDta6OQCbALQGrCI6ngKwQffR3dfsfrwrfs</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">私钥信息</label>
                            <div class="layui-input-block">
                                <input type="text" name="txcos_secret_key" class="layui-input" lay-verify="required" lay-reqtext="请输入私钥信息" placeholder="请输入私钥信息" value="{:sysconfig('txcos','txcos_secret_key')}">
                                <tip>例子：VllEWYKtClAbpqfFdTqysXxGQM6dsfs</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">存储桶地域</label>
                            <div class="layui-input-block">
                                <input type="text" name="txcos_region" class="layui-input" lay-verify="required" lay-reqtext="请输入存储桶地域" placeholder="请输入存储桶地域" value="{:sysconfig('txcos','txcos_region')}">
                                <tip>例子：ap-guangzhou</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">存储桶名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="tecos_bucket" class="layui-input" lay-verify="required" lay-reqtext="请输入存储桶名称" placeholder="请输入存储桶名称" value="{:sysconfig('txcos','tecos_bucket')}">
                                <tip>例子：laysns-1251997243</tip>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">自定义源站域名</label>
                            <div class="layui-input-block">
                                <input type="text" name="txcos_domain" class="layui-input" lay-verify="required" lay-reqtext="请输入访问域名" placeholder="请输入访问域名" value="{:sysconfig('txcos','txcos_domain')}">
                                <tip>例子：http://img-tx.laysns.com</tip>
                            </div>
                        </div>

                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>
                </div>
            </div>
        </div>

    </div>
</div>
<script>
    var upload_type = "{:sysconfig('upload','upload_type')}";
</script>
